
import actions from './actions'
import getters from './getters'
import mutations from './mutations'

const state = {
  lists: [
    { id: 'role1', dot: false, icon: 'el-icon-menu', name: '新建订单', router: '/report' },
    { id: 'role2', dot: false, icon: 'el-icon-menu', name: '订单', router: '/orders' },
    { id: 'role3', dot: false, icon: 'el-icon-menu', name: '品牌商', router: '/brand' },
    { id: 'role4', dot: false, icon: 'el-icon-menu', name: '服务商', router: '/server' },
    { id: 'role5', dot: false, icon: 'el-icon-menu', name: '用户', router: '/users' },
    { id: 'role6', dot: false, icon: 'el-icon-menu', name: '客服', router: '/service' },
    { id: 'role7', dot: false, icon: 'el-icon-menu', name: '财务', router: '/finance' }
  ],
  roles: {
    'super': [0, 1, 2, 3, 4, 5, 6],
    'server': [1, 2, 3, 4],
    'finance': [1, 2, 3, 6],
    'manager': [0, 1, 3, 6],
    'tech': [1],
    'business': [1]
  },
  current_slides: []
}

const slide = {
  state,
  getters,
  actions,
  mutations
}

if (module.hot) {
  module.hot.accept([
    './actions',
    './getters',
    './mutations'
  ], () => {
    slide.hotUpdate({
      actions: require('./actions'),
      getters: require('./getters'),
      mutations: require('./mutations')
    })
  })
}

export default slide
